home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-0195.lzh / AMOSLIST / text0257.txt < prev    next >
Encoding:
Text File  |  1995-02-01  |  1.5 KB  |  54 lines

  1. I have a few questions about Amos Pro:
  2.  
  3. 1) Is there an AGA extension yet?
  4. 2) Is there any way to read a two-button joystick from either port?
  5.  
  6. And a general question about coding:
  7.  
  8. What is a good procedure for detecting a "tap" of a fire button and a 
  9. "press" (button held down)? Right now I have something like
  10.  
  11. Procedure TESTHOLDBUTTON[STICK]
  12. '
  13. ' STICK is the port number
  14. '
  15. X = TRUE
  16. DELAY = 1200 : ' this is arbitrary
  17. While X = True
  18.     X = Fire(STICK)
  19.     Z = Z + 1
  20.     If Z > DELAY Then X = False : ' Break out of loop if button held
  21. too long                     
  22. Wend
  23. If Z < DELAY
  24.     R = False
  25. Else
  26.     R = True
  27. End If
  28. End Proc[R]
  29. '
  30. ' R tells calling procedure whether button was tapped (False) or pressed 
  31. ' (True).
  32. '
  33.  
  34. This procedure works fine except that when I let go of the pressed button, 
  35. the procedure registers a press AND a tap. I suspect that it's because 
  36.  
  37. a) procedure is called
  38. b) procedure is exited when "True" is returned, but button is still held
  39. c) procedure is called and exited again and again...
  40. d) eventually, Z < DELAY after n number of procedure calls
  41.  
  42. Any way to fix this?
  43.  
  44. ----------------------------------------------------------------------------
  45. | Carl Chavez            Why is the audio tape "How to Get Your     |
  46. | foregone@u.washington.edu    Point Across in 30 Seconds or Less?"       |
  47. | co-writer, NBA Jam FAQs    (Simon & Schuster, #60247-0) a *60-minute* |
  48. | Dobar dan! Kako si?                         tape?       |
  49. | BOB is coming. Beware of BOB. "Open the garage bay doors, BOB." -D.Bowman|
  50. ----------------------------------------------------------------------------
  51.  
  52.  
  53.  
  54.